from domain.model.platform.base import BasePlatformChatModel


class DeepseekChatModel(BasePlatformChatModel):
    PLATFORM_NAME = "deepseek"
    SUPPORT_MODEL_LIST = ['deepseek-chat', 'deepseek-reasoner']
    MODEL_INSTANCE_MAP = {}

    def init_model(self, *model_names: str, **options: object) -> "BasePlatformChatModel":
        super().init_model(*model_names, **options)
        from langchain_deepseek import ChatDeepSeek
        for model in model_names:
            self.MODEL_INSTANCE_MAP[model] = ChatDeepSeek(
                model=model,
                api_key=options.get('api_key'),
                temperature=options.get('temperature', 0),
                max_tokens=options.get('max_token', 8192),
            )
        return self


deepseek_chat_model = DeepseekChatModel()
